#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int n = 0;
	int i = 0;
	int j = 0;
	scanf("%d", &n);
	for (i = 1; i <= n; i++)
	{
		printf("* ");
	}
	printf("\n");
	for (j = 1; j <= n - 2; j++)
	{
		printf("* ");
		for (i = 1; i <= n - 2; i++)
		{
			printf("  ");
		}
		printf("*");
		printf("\n");
	}
	for (i = 1; i <= n; i++)
	{
		printf("* ");
	}
	printf("\n");
	return 0;
}